package io.github.zhengyue.oop

/**
 * 封装
 */
class Dog {
    private var name:String = "小黑"
    fun setName(name: String) {
        this.name = name
    }

    fun getName():String {
        return this.name
    }
}

fun main(args: Array<String>) {
    var dog = Dog()
    println(dog.getName())

    dog.setName("小黄")
    println(dog.getName())
}